<template>
	<w-container class=' plr-16' :loading="loading">
		<w-navbar id="my-nav" bgColor="#fff" :title="title"></w-navbar>
		<view class="pt-20">
			<view class="flex flex-ai-center mb-4">
				<view style="color: #333;" class="font-size-12">公告</view>
				<w-icon name="right" size="22"></w-icon>
				<view class="font-size-12 font-color-theme">活动公告</view>
			</view>
			<view class="font-color-textPrimary font-w-600">
				{{info.title&&handleLang(info.title)}}
			</view>  
			<view class="flex flex-ai-center ptb-8 font-size-12 mb-16 font-color-666" >
				<!-- <text v-if="category" class="mr-12">{{category&&handleLang(category)}}</text>
				<text class="mr-12 font-color-666">{{ appConfig.appName }}</text> -->
				<text>{{info.createtime|formatDate}}</text>
			</view>
			<u-parse :content='info.content&&handleLang(info.content)' :previewImg="false"></u-parse>
		</view>
	</w-container>
</template>

<script>
	import {
		getNoticeDetails
	} from '@/api/notice/index.js'
	export default {
		data() {
			return {
				title: '公告详情',
				loading: false,
				info: {},
				category:'',
				bgColor:'#fff'
			}
		},
		onPageScroll({scrollTop}) {
			// if(scrollTop < 30) this.bgColor = 'unset'
			// else this.bgColor = '#fff'
		},
		onLoad({
			id,
			category
		}) {
			this.category = category
			this.getInfo(id)
		},
		methods: {
			getInfo(id) {
				this.loading = true
				getNoticeDetails(id).then(res => {
					this.loading = false;
					this.info = res.data;
				}).catch( err => {
					
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
